package com.doctcloud.hisinfo.histable.domain.comm;

import com.baomidou.mybatisplus.annotation.TableField;
import com.doctcloud.common.core.annotation.Excel;
import com.doctcloud.common.core.annotation.TableDesc;
import com.doctcloud.hisinfo.histable.document.FileInfoDo;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import static com.doctcloud.common.core.utils.StringUtils.trim;

/**
 * @ClassName 科室字典实体类
 * @Author samula
 * @Descripe product by com.doctcloud
 * @Data 2025-09-23 1:21
 **/

@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = {"deptCode"})
@ToString
@Data
@TableDesc("科室字典")
public class DeptDictDo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Excel(name = "序号",cellType = Excel.ColumnType.NUMERIC)
    private Integer serialNo;
    @Excel(name = "科室代码")
    @Size(min = 0, max = 8, message = "科室代码长度不能超过8个字符")
    @NotBlank(message = "科室代码不得为空")
    private String deptCode;
    @Excel(name = "科室名称")
    @Size(min = 0, max = 20, message = "科室名称长度不能超过20个字符")
    @NotBlank(message = "科室名称不得为空")
    private String deptName;
    @Excel(name = "科室别名")
    @Size(min = 0, max = 20, message = "科室别名长度不能超过20个字符")
    private String deptAlias;
    @Excel(name = "临床科室属性", readConverterExp = "0=临床,1=辅诊,2=护理单元,3=机关,4=其他")
    private Integer clinicAttr;
    @Excel(name = "门诊住院科室标志", readConverterExp = "0=门诊,1=住院,2=急观,3=互联网,8=体检,9=其他")
    private Integer outpOrInp;
    @Excel(name="内外科标志", readConverterExp = "0=内科,1=外科,9=其他")
    private Integer internalOrSergery;
    @Excel(name = "拼音码")
    @Size(min = 0, max = 8, message = "拼音码长度不能超过8个字符")
    private String inputCode;
    @Excel(name = "有效标记", readConverterExp = "1=正常,0=停用")
    private Integer enable = 1; // 默认值 1（有效）
    @Excel(name = "院区标记", readConverterExp = "0=杨浦,1=安亭,*=通用")
    private String hospitalId = "*";

    @Excel(name = "位置")
    @TableField(exist = false)
    private String position;
    @Excel(name = "科室简述")
    @TableField(exist = false)
    private String deptDesc;
    @Excel(name = "负责人")
    @TableField(exist = false)
    private String leader;
    @TableField(exist = false)
    @Excel(name="联系电话")
    private String phone;
    @Excel(name = "创建人员")
    private String createBy;
    @Excel(name = "创建日期", width = 30,dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @Excel(name = "更新人员")
    private String updateBy;
    @Excel(name = "更新日期", width = 30,dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateDate;
    @TableField(exist = false)
    private String deptDescDetail;
    @TableField(exist = false)
    private String buckets;
    @TableField(exist = false)
    private List<FileInfoDo> fileInfos;
    @TableField(exist = false)
    private String internalOrSergenryName;
    @TableField(exist = false)
    private String ClinicAttrName;
    @TableField(exist = false)
    private String OutpOrInpName;
    /** 子部门 */
    @TableField(exist = false)
    private List<DeptDictDo> children = new ArrayList<DeptDictDo>();

    @Data
    public static class primaryKey {
        private final String deptCode;
        public primaryKey(String deptCode) {
            this.deptCode = deptCode;
        }
    }

    public void setDeptCode(String deptCode) {
        this.deptCode = trim(deptCode);
    }

    public void setDeptName(String deptName) {
        this.deptName = trim(deptName);
    }

    public void setDeptAlias(String deptAlias) {
        this.deptAlias = trim(deptAlias);
    }

    public void setInputCode(String inputCode) {
        this.inputCode = trim(inputCode);
    }

    public void setPosition(String position) {
        this.position = trim(position);
    }

    public void setDeptDesc(String deptDesc) {
        this.deptDesc = trim(deptDesc);
    }

    public void setLeader(String leader) {
        this.leader = trim(leader);
    }

    public void setPhone(String phone) {
        this.phone = trim(phone);
    }

    public void setCreateBy(String createBy) {
        this.createBy = trim(createBy);
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = trim(updateBy);
    }

    public void setDeptDescDetail(String deptDescDetail) {
        this.deptDescDetail = trim(deptDescDetail);
    }

    public void setBuckets(String buckets) {
        this.buckets = trim(buckets);
    }

    ////    public String getDeptName() {
////        return super.processGet(deptName);
////    }
////
////    public void setDeptName(String deptName) {
////        this.deptName = super.processSet(deptName);
////    }
////
////    public String getDeptAlias() {
////        return super.processGet(deptAlias);
////    }
//
//    public void setDeptAlias(String deptAlias) {
//        this.deptAlias = super.processSet(deptAlias);
//    }
//
//    public String getDeptDesc() {
//        return super.processGet(deptDesc);
//    }
//
//    public void setDeptDesc(String deptDesc) {
//        this.deptDesc = super.processSet(deptDesc);
//    }
}